import {reqSearchInfo} from '@/api'
const actions={
    async getSearchInfo({commit},params){
       let result=await reqSearchInfo(params)
       if(result.code===200){
           commit('SAVE_SEARCH_INFO',result.data)
       }else{
           alert(result.message)
       }
    }
}
const mutations={
    SAVE_SEARCH_INFO(state,info){
        state.searchInfo=info
    }
}
const state={
    searchInfo:{}
}
const getters={
    goodsList(state){
        return state.searchInfo.goodsList
    },
    attrsList(state){
        return state.searchInfo.attrsList
    },
    trademarkList(state){
        return state.searchInfo.trademarkList
    },
    total(state){
        return state.searchInfo.total
    }
}
export default {
    actions,
    mutations,
    state,
    getters
}